<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">

  <title>注册</title>

  <div th:include="commen :: #common_link"></div>

</head>
<body>
<div th:include="commen :: #common_nav"></div>
<!-- Page Header -->
<header class="masthead" style="background-image: url('/images/flower.jpg')">
    <div class="overlay"></div>
    <div class="container">
      <div class="row">
        <div class="col-lg-8 col-md-10 mx-auto">
          <div class="page-heading">
            <h1>用户注册</h1>
            <span class="subheading">来吧，加入我们！</span>
          </div>
        </div>
      </div>
    </div>
  </header>

  <!-- Main Content -->
  <div class="container">
    <div class="row">
      <div class="col-lg-8 col-md-10 mx-auto">
        <p>想要和我们一起分享有趣的故事吗？立即注册一个账号，加入我们吧！</p>
        <!-- Contact Form - Enter your email address on line 19 of the mail/contact_me.php file to make this form work. -->
        <!-- WARNING: Some web hosts do not allow emails to be sent through forms to common mail hosts like Gmail or Yahoo. It's recommended that you use a private domain email address! -->
        <!-- To use the contact form, your site must be on a live web host with PHP! The form will not work locally! -->
        <form method="post" th:action="@{/registerC}" >
            <div class="control-group">
                <div class="form-group floating-label-form-group controls">
                  <label>用户名</label>
                  <input type="text" class="form-control" placeholder="用户名" name="name" id="name" required data-validation-required-message="请输入你的账号。">
                  <p class="help-block text-danger"></p>
                </div>
              </div>
          <div class="control-group">
            <div class="form-group col-xs-12 floating-label-form-group controls">
              <label>密码</label>
              <input type="password" class="form-control" placeholder="密码" name="pwd" id="pwd" required data-validation-required-message="请输入密码。">
              <p class="help-block text-danger"></p>
            </div>
          </div>
          <div class="control-group">
            <div class="form-group col-xs-12 floating-label-form-group controls">
              <label>再次输入密码</label>
              <input type="password" class="form-control" placeholder="再次输入密码" name="pwd2" id="pwd2" required data-validation-required-message="请输入密码。">
              <p class="help-block text-danger"></p>
            </div>
          </div>
          <div class="control-group">
            <div class="form-group floating-label-form-group controls">
              <label>Email</label>
              <input type="email" class="form-control" placeholder="Email" name="email" id="email" required data-validation-required-message="请输入正确的邮件地址。">
              <p class="help-block text-danger"></p>
            </div>
          </div>
          <br>
          <div id="success"></div>
          <div class="form-group">
            <button type="submit" class="btn btn-primary" id="sendMessageButton">注册</button>
          </div>
        </form>
      </div>
    </div>
  </div>

<div th:include="commen :: #common_footer"></div>
<div th:if="${session.get('emailRepeat')}!=null">
  <script>
    alert('邮箱已经被注册！');
  </script>
</div>
<div th:if="${session.get('nameRepeat')}!=null">
  <script>
    alert('用户名已经被注册！');
  </script>
</div>
<div th:if="${session.get('passwordRepeat')}!=null">
  <script>
    alert('密码输入不一致！');
  </script>
</div>
</body>
</html>
